package com.qiaofang.common.utils;

import com.qiaofang.common.constant.ExceptionEnum;
import com.qiaofang.common.exception.BusinessException;
import lombok.Data;

import java.util.Map;

@Data
public class UploadFileResult {

    private final String IMG_NAME = "imgName";

    private String result;

    private Map resData;

    public String getUrl() {
        if (resData != null) {
            if (resData.containsKey(IMG_NAME)) {
                return (String) resData.get(IMG_NAME);
            }
        }
        throw new BusinessException(ExceptionEnum.UPLOAD_EXCEPTION);
    }

}
